🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

@csstools/postcss-progressive-custom-properties

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@csstools/postcss-progressive-custom-properties

Correctly declare progressive enhancements for CSS Custom Properties.

1.3.0
Source
npm
Version published
Weekly downloads
3.7M
-13.99%
Maintainers
2
Weekly downloads
 
Created

What is @csstools/postcss-progressive-custom-properties?

@csstools/postcss-progressive-custom-properties is a PostCSS plugin that allows you to progressively enhance your CSS custom properties (variables). It enables you to use custom properties in a way that provides fallbacks for older browsers that do not support them, ensuring a smoother transition and better compatibility.

What are @csstools/postcss-progressive-custom-properties's main functionalities?

Progressive Enhancement of Custom Properties

This feature allows you to define custom properties and use them in your CSS. The plugin will automatically add fallback values for browsers that do not support custom properties.

/* Input CSS */
:root {
  --main-color: #3498db;
}

body {
  color: var(--main-color);
}

/* Output CSS */
:root {
  --main-color: #3498db;
}

body {
  color: #3498db;
  color: var(--main-color);
}

Custom Property Fallbacks

This feature allows you to specify fallback values for custom properties. The plugin ensures that the fallback value is used in browsers that do not support custom properties.

/* Input CSS */
:root {
  --padding: 10px;
}

.container {
  padding: var(--padding, 20px);
}

/* Output CSS */
:root {
  --padding: 10px;
}

.container {
  padding: 20px;
  padding: var(--padding, 20px);
}

Other packages similar to @csstools/postcss-progressive-custom-properties

Keywords

css

FAQs

Package last updated on 07 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts